package com.homework.ch06;

public class Truck extends Automobile{
    private String type;
    public Truck(String brand,String plateNumber,String type)
    {
        super(brand,plateNumber);
        this.type=type;
    }
    @Override
    public int getRent(int day)
    {
        switch(this.type)
        {
            case "小型":
                setPrice(300);
                break;
            case "中型":
                setPrice(350);
                break;
            case "大型":
                setPrice(500);
                break;
        }
        return day*getPrice();
    }
}
